home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / fpk65_66.zip / SOURCE / RTL / DOS / PRT0.S < prev    next >
Text File  |  1996-11-07  |  2KB  |  75 lines

  1. //****************************************************************************
  2. //
  3. //                      Copyright (c) 1993,1996 by Florian Klaempfl
  4. //
  5. // ****************************************************************************}
  6. //
  7. //
  8. //  this file is part of the FPKPascal run time library and contains the
  9. //  startup code of FPKPascal
  10. //
  11. // called as start(argc, argv, envp) (c calling conventions)
  12. //
  13. // gs:edx points to such a record:
  14. //    size_of_this_structure_in_bytes : longint;
  15. //    linear_address_of_primary_screen : longint;
  16. //    linear_address_of_secondary_screen : longint;
  17. //    linear_address_of_transfer_buffer : longint;
  18. //    size_of_transfer_buffer : longint;
  19. //    pid : longint;
  20. //    master_interrupt_controller_base : byte
  21. //    slave_interrupt_controller_base : byte
  22. //    selector_for_linear_memory : word;
  23. //    linear_address_of_stub_info_structure : longint;
  24. //    linear_address_of_original_psp : longint;
  25. //    run_mode : word;
  26. //    run_mode_info : word;
  27.   
  28.     .text
  29.  
  30.     .long    0        /* in case of null references */
  31.     .long    0
  32.  
  33.     .globl    start
  34. start:
  35.         movw    %gs:36(%edx),%ax
  36.         movw    %ax,_run_mode
  37.         movw    %gs:26(%edx),%ax
  38.         movw    %ax,_core_selector
  39.     movl    %ebx,_ScreenPrimary
  40.     movl    %esp,%ebx
  41.     movl    8(%ebx),%eax
  42.     movl    %eax,_environ
  43.     movl    4(%ebx),%eax
  44.     movl    %eax,_args
  45.     movl    (%ebx),%eax
  46.     movl    %eax,_argc
  47.  
  48.     call    PASCALMAIN
  49.  
  50.     movl    $0x4c00,%eax
  51.     int    $0x21
  52.  
  53.     ret
  54.  
  55.     .data
  56.  
  57.     .globl    _environ
  58. _environ:
  59.     .long    0
  60.     .globl    _ScreenPrimary
  61. _ScreenPrimary:
  62.     .long    0
  63.     .globl  _run_mode
  64. _run_mode:
  65.     .word 0
  66.         .globl _core_selector
  67. _core_selector:
  68.     .word 0
  69.     .globl  _argc
  70. _argc:
  71.     .long   0
  72.     .globl  _args
  73. _args:
  74.     .long    0
  75.